# koroFileHeader at Home PC
# Create: 2022-03-12 15:20:41
# LastEdit: 2022-03-13 11:46:47
"""说明暂无"""
__author__ = '749B'


import pytest
import smtplib

# @pytest.fixture(scope="module")
@pytest.fixture(scope="session")
def smtp_connection():
    return smtplib.SMTP("smtp.163.com", 25, timeout=5)

@pytest.fixture(scope="module")
def smtp_connection2(request):
    server = getattr(request.module, "smtpserver", "smtp.gmail.com")
    smtp_connection = smtplib.SMTP(server, 587, timeout=5)
    yield smtp_connection
    print("finalizing {} ({})".format(smtp_connection, server))
    smtp_connection.close()

